import { lazy } from 'react'
import { WapHomeO,CouponO,Points,CartO,ManagerO } from '@react-vant/icons'

export let mainRouter =[
    {
        path:'/home/shou',
        element:lazy(()=> import('../views/Home/Shou')),
        title:"首页",
        icon:<WapHomeO  />
    },
    {
        path:'/home/classify',
        element:lazy(()=> import('../views/Home/Classify')),
        title:"分类",
        icon:<CouponO  />
    },
    {
        path:'/home/eat',
        element:lazy(()=> import('../views/Home/Eat')),
        title:"吃好",
        icon:<Points  />
    },
    {
        path:'/home/cart',
        element:lazy(()=> import('../views/Home/Cart')),
        title:"购物车",
        icon:<CartO  />
    },
    {
        path:'/home/my',
        element:lazy(()=> import('../views/Home/My')),
        title:"我的",
        icon:<ManagerO  />
    }
]

const routes =[
    {
        path:'*',
        element:lazy(()=> import('../views/Error'))
    },
    {
        path:'/home',
        element:lazy(()=> import('../views/Home')),
        children:mainRouter
    },
    {
        path:'/detail/:id',
        element:lazy(()=> import('../views/Detail'))
    },
    {
        path:'/login',
        element:lazy(()=> import('../views/Login'))
    },
    {
        from:'/',
        to:"/home/shou"
    } 
]

export default routes;